<?php
/*
 * @ https://EasyToYou.eu - IonCube v11 Decoder Online
 * @ PHP 7.2 & 7.3
 * @ Decoder version: 1.1.6
 * @ Release: 10/08/2022
 */

// Decoded file for php version 71.
class PHPExcel_Writer_Excel5_Font
{
    private $colorIndex;
    private $font;
    private static $mapUnderline;
    public function __construct(PHPExcel_Style_Font $font = NULL)
    {
        $this->colorIndex = 32767;
        $this->font = $font;
    }
    public function setColorIndex($colorIndex)
    {
        $this->colorIndex = $colorIndex;
    }
    public function writeFont()
    {
        $font_outline = 0;
        $font_shadow = 0;
        $icv = $this->colorIndex;
        if($this->font->getSuperScript()) {
            $sss = 1;
        } elseif($this->font->getSubScript()) {
            $sss = 2;
        } else {
            $sss = 0;
        }
        $bFamily = 0;
        $bCharSet = PHPExcel_Shared_Font::getCharsetFromFontName($this->font->getName());
        $record = 49;
        $reserved = 0;
        $grbit = 0;
        if($this->font->getItalic()) {
            $grbit |= 2;
        }
        if($this->font->getStrikethrough()) {
            $grbit |= 8;
        }
        if($font_outline) {
            $grbit |= 16;
        }
        if($font_shadow) {
            $grbit |= 32;
        }
        $data = pack("vvvvvCCCC", $this->font->getSize() * 20, $grbit, $icv, self::mapBold($this->font->getBold()), $sss, self::mapUnderline($this->font->getUnderline()), $bFamily, $bCharSet, $reserved);
        $data .= PHPExcel_Shared_String::UTF8toBIFF8UnicodeShort($this->font->getName());
        $length = strlen($data);
        $header = pack("vv", $record, $length);
        return $header . $data;
    }
    private static function mapBold($bold)
    {
        if($bold) {
            return 700;
        }
        return 400;
    }
    private static function mapUnderline($underline)
    {
        if(isset(self::$mapUnderline[$underline])) {
            return self::$mapUnderline[$underline];
        }
        return 0;
    }
}

?>